package com.mingdong.first.xiangyuan;

import java.util.HashMap;
import java.util.Map;

public class ChessFlyWeightFactory {

	private static Map<String, ChessFlyWeight> map = new HashMap<String, ChessFlyWeight>();
	
	public static  ChessFlyWeight getChess(String color){
		
		if(map.get(color) != null){
			return map.get(color);
		}else{
			ChessFlyWeight  c = new ConCreateChess(color);
			map.put(color, c);
			return c;
		}
		
	}
	
}
